package team.first.movieapiv3pro.movie;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;

/**
 * @Author: HAPPY
 * @Project_name: project
 * @Package_name: team.first.movieapiv3.admin
 * @Date: 2021/12/22 10:27
 * @Description:
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@NodeEntity(label = "Genre")
public class GenreNode implements Comparable{
    @Id
    private Integer id;
    private String name;

    @Override
    public int compareTo(Object o) {
        GenreNode genreNode = (GenreNode) o;
        if (this.id < genreNode.id)
            return -1;
        else {
            if (this.id == genreNode.id) {
                return 0;
            }
        }
        return 1;
    }
}
